package com.haiyou.data.config.base;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

public abstract class BaseMapProvider<K, V> {
	protected Map<K, V> dataMap;
	
	public V get(K k) {
		return dataMap.get(k);
	}
	
	public void put(K k, V v){
		dataMap.put(k, v);
	}
	
	public Set<K> keys(){
		return dataMap.keySet();
	}

	public Collection<V> values() {
		return dataMap == null ? null : dataMap.values();
	}

	public int size() {
		return dataMap == null ? 0 : dataMap.size();
	}

	public boolean isEmpty() {
		return dataMap == null || dataMap.isEmpty();
	}

	public void remove(K k) {
		dataMap.remove(k);
	}
	
	public boolean containsKey(K k){
		return dataMap.containsKey(k);
	}
}